package com.demo.activator;

import com.demo.impl.Calculation;
import com.demo.intf.ICalculation;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;

import java.util.Dictionary;
import java.util.Hashtable;

public class Activator implements BundleActivator {

    public void start(BundleContext bundleContext) throws Exception {
        Dictionary<String, String> props = new Hashtable<String, String>();
        props.put("ServiceName", "Calculation");
        bundleContext.registerService(ICalculation.class.getName(), new Calculation(), props);
        System.out.println("Service registered!");
    }

    public void stop(BundleContext bundleContext) throws Exception {
        System.out.println("Stop demo2 bundle!");
    }
}
